﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;

namespace Storage
{
    public partial class BillMode : Form
    {
        public BillMode()
        {
            InitializeComponent();
        }

        public void FillComboBox(ComboBox cb, string cmd)
        {
            MySQLDriver drv = MySQLDriver.GetDriver;
            MySqlDataReader reader = drv.Read(cmd);
            while (reader.Read())
            {
                cb.Items.Add(new Outlets(reader.GetString(0)).Name);
            }
            //cb.SelectedIndex = 0;
            drv.CloseConnection();
        }
        private void BillMode_Load(object sender, EventArgs e)
        {
            string cmd = "SELECT name from outlets";
            FillComboBox(outletCbx, cmd);
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void button5_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
